/*
 * (C) Copyright 2023 orchy
 * This file is licensed under the BSD-3-Clause license.
 * <https://spdx.org/licenses/BSD-3-Clause.html>
 */
#ifndef _WCHAR_H
#define _WCHAR_H

// # 7.24.1
// ## 7.24.1.2
#ifndef _WCHAR_T_DEFINED
  typedef long long int wchar_t;
  #define _WCHAR_T_DEFINED
#endif

#ifndef _SIZE_T_DEFINED
  typedef long long int size_t;
  #define _SIZE_T_DEFINED
#endif

typedef int mbstate_t;
#ifndef _WINT_T_DEFINED
  typedef int wint_t;
  #define _WINT_T_DEFINED
#endif
struct tm;

// ## 7.24.1.3
#ifndef NULL
  #define NULL ((void*)0)
#endif

#ifndef WCHAR_MIN
  #define WCHAR_MIN (-2147483648)
  #define WCHAR_MAX (2147483647)
#endif

#ifndef WEOF
  #define WEOF (-1)
#endif

#include <__file.h>
#include <__stdarg.h>
// ## 7.24.2.1
int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...);

// ## 7.24.2.2
int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...);

// ## 7.24.2.3
int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...);

// ## 7.24.2.4
int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...);

// ## 7.24.2.5
int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, __va_list arg);

// ## 7.24.2.6
int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, __va_list arg);

// ## 7.24.2.7
int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, __va_list arg);

// ## 7.24.2.8
int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, __va_list arg);

// ## 7.24.2.9
int vwprintf(const wchar_t* restrict format, __va_list arg);

// ## 7.24.2.10
int vwscanf(const wchar_t* restrict format, __va_list arg);

// ## 7.24.2.11
int wprintf(const wchar_t* restrict format, ...);

// ## 7.24.2.12
int wscanf(const wchar_t* restrict format, ...);

// # 7.24.3
// ## 7.24.3.1
wint_t fgetwc(FILE* stream);

// ## 7.24.3.2
wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream);

// ## 7.24.3.3
wint_t fputwc(wchar_t c, FILE* stream);

// ## 7.24.3.4
int fputws(const wchar_t* restrict s, FILE* restrict stream);

// ## 7.24.3.5
int fwide(FILE* stream, int mode);

// ## 7.24.3.6
wint_t getwc(FILE* stream);

// ## 7.24.3.7
wint_t getwchar(void);

// ## 7.24.3.8
wint_t putwc(wchar_t c, FILE* stream);

// ## 7.24.3.9
wint_t putwchar(wchar_t c);

// ## 7.24.3.10
wint_t ungetwc(wint_t c, FILE* stream);

// # 7.24.4
// ## 7.24.4.1
// ### 7.24.4.1.1
double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr);
float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr);
long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr);

// ### 7.24.4.1.2
long int wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
long long int wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
unsigned long int wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
unsigned long long int wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);

// ## 7.24.4.2
// ### 7.24.4.2.1
wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2);

// ### 7.24.4.2.2
wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);

// ### 7.24.4.2.3
wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);

// ### 7.24.4.2.4
wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);

// ## 7.24.4.3
// ### 7.24.4.3.1
wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2);

// ### 7.24.4.3.2
wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);

// ## 7.24.4.4
// ### 7.24.4.4.1
int wcscmp(const wchar_t* s1, const wchar_t* s2);

// ### 7.24.4.4.2
int wcscoll(const wchar_t* s1, const wchar_t* s2);

// ### 7.24.4.4.3
int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n);

// ### 7.24.4.4.4
size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);

// ### 7.24.4.4.5
int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n);

// ## 7.24.4.5
// ### 7.24.4.5.1
wchar_t* wcschr(const wchar_t* s, wchar_t c);

// ### 7.24.4.5.2
size_t wcscspn(const wchar_t* s1, const wchar_t* s2);

// ### 7.24.4.5.3
wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2);

// ### 7.24.4.5.4
wchar_t* wcsrchr(const wchar_t* s, wchar_t* c);

// ### 7.24.4.5.5
size_t wcsspn(const wchar_t* s1, const wchar_t* s2);

// ### 7.24.4.5.6
wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2);

// ### 7.24.4.5.7
wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr);

// ### 7.24.4.5.8
wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);

// ## 7.24.4.6
// ### 7.24.4.6.1
size_t wcslen(const wchar_t* s);

// ### 7.24.4.6.2
wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);

// ## 7.24.5
// ### 7.24.5.1
size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, const struct tm* restrict timeptr);

// # 7.24.6
// ## 7.24.6.1
// ### 7.24.6.1.1
wint_t btowc(int c);

// ### 7.24.6.1.2
int wctob(wint_t c);

// ## 7.24.6.2
// ### 7.24.6.2.1
int mbsinit(const mbstate_t* ps);

// ## 7.24.6.3
// ### 7.24.6.3.1
size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps);

// ### 7.24.6.3.2
size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps);

// ### 7.24.6.3.3
size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps);

// ## 7.24.6.4
// ### 7.24.6.4.1
size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, mbstate_t* restrict ps);

// ### 7.24.6.4.2
size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, mbstate_t* restrict ps);

#endif
